-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enable c api for android ci #1635
Conversation
Thank you for your contribution! |
Will release a new version on the coming Sunday this week. |
hello, great work! |
thank you, sadly it still didn't work for me, i am trying to do an android build with unity, the moment i call the a function from the dll the app crashes (in an apk android build), do you have any idea why? |
please post error logs. otherwise, no one except you knows what is happening. |
that's the issue, the app quits, before leaving any log (only log before the the plugin functions is shown), at least that's what i observed from unity, i will see if i can get direct log using logcat |
from the log Please check that the file is placed in the correct location. |
i see, the file is indeed placed correctly, but now i understand the problem, unity packs the location its in (StreamingAssets folder) differently in android, and IO operations won't be able to access it like that.. this is bad, i will need to find an alternative way to load the models on android |
Here is the log from sherpa-onnx. It shows you have indeed passed some parameters to sherpa-onnx's C API. Please pay attention to the path.
The C++ code uses I don't know what the meaning of |
Can you first copy the files from assets into disk? |
Or does unity provide C or C++ APIs to read files from assets? If so, we can change sherpa-onnx to support that as long as you can help to test the changes. |
i think it's possible using AndroidJavaClass class in unity, but the easiest way would be to copy the models into a readable location once on android, there is way to load such files in unity using UnityWebRequest, load them from the StreamingAssets location, and copy them somewhere differently (on a readable path), then i can pass the new path to the sherpa plugin, and this has to be done only the first time you open the apk, this is the best work-around usually, if you want i can provide the code i will write for that later :) |
Once it works for you, it would be great if you can post the code here so that others won't get the same issues. |
i am unsure about the espeak data path however, how is the plugin reading it? |
It is the same as the model, e.g., the same as tokens.txt Just copy the folder from the assets to some locations and pass the path to sherpa-onnx. |
By the way, you need to copy all the files from espeak-ng-data directory and you need to keep the structure of epseak-ng-data. espeak-ng-data also contains sub-directories. |
okay, working on it |
Good news! i got it to work, here is an apk to test, i will provide a cleaned version of the code involved later in the day, and hopefully make an asset store package after that with more automated features like voice models download and easy integration of sherpa-onnx in unity, having packages for this in game engines such as unity and unreal engine is the way to make this super project super popular! great work @csukuangfj! |
Thanks! |
question: is token.txt file common for all models, or does each model have a separate one? |
Resolve #1634